package 力扣日常刷题.木23一月.第15天315;

/**
 * @author 帅小伙
 * @date 2022/3/15
 * @description
 */
public class Demo81Excel表列名称 {


    public  String convertToTitle(int n) {
        if(n <= 0) return "";
        StringBuilder sb = new StringBuilder();
        while(n >0) {
            n--;
            sb.append((char)(n % 26)+'A');
            n = n/26;
        }
        return sb.reverse().toString();
    }
}
